//
//  AttentionSecData.m
//  FLLGodOfCooking
//
//  Created by LL.F on 16/09/07
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "AttentionSecData.h"
#import "AttentionComment.h"
#import "AttentionLike.h"
#import "AttentionTopics.h"

@implementation AttentionSecData

+ (NSDictionary *)objectClassInArray{
    return @{@"comment" : [AttentionComment class], @"like" : [AttentionLike class], @"topics" : [AttentionTopics class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"topics"]) {
        NSMutableArray<AttentionTopics *>  *topicsArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            AttentionTopics *data = [AttentionTopics modelWithDic:dic];
            [topicsArray addObject:data];
        }
        _topics = topicsArray;
    }
    if ([key isEqualToString:@"comment"]) {
        NSMutableArray<AttentionComment *>  *commentArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            AttentionComment *data = [AttentionComment modelWithDic:dic];
            [commentArray addObject:data];
        }
        _comment = commentArray;
    }
    if ([key isEqualToString:@"like"]) {
        NSMutableArray<AttentionLike *>  *likeArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            AttentionLike *data = [AttentionLike modelWithDic:dic];
            [likeArray addObject:data];
        }
        _like = likeArray;
    }
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"id"]) {
        _id_Data = value;
    } if ([key isEqualToString:@"description"]) {
        _description_Data = value;
    }
}
@end
